1. Field of the Invention
The present invention relates to a numerical controller that controls a machine tool, and in particular, to a numerical controller with an inter-path waiting function of allowing control paths to cooperatively suspend operations of a machining program.
2. Description of the Related Art
Each of a plurality of drive sections of a machine tool such as a plurality of turrets in an NC lathe is operated by one or more movable axes. In order to operate the movable axes for each drive section independently and in parallel by a separate machining program, a numerical controller that controls the machine tool has one or more control paths performing a machining program pre-read/analysis process and a machining program execution process, and having axis control sections. (In a schematic block diagram of a numerical controller shown in FIG. 1, the control path corresponds to a processor 51 and a first control path axis control section to an nth control path axis control section 57-1 to 57-n).
In this case, each of the plurality of control paths operates independently, but the control paths can cooperatively suspend operations so that machining programs for the respective control paths can be executed in a timely manner. This is referred to as an inter-path waiting function.
Furthermore, if the numerical controller operates a machining program recorded in a memory or external storage means, the numerical controller needs to carry out, for each block of the machining program, two roughly classified processes:
(a) a pre-read/analysis process of sequentially pre-reading and analyzing the block of the machining program to create code analysis data and create execution data from the created code analysis data, and
(b) an execution process of actually moving axes and updating coordinate values based on the execution data created by the pre-read/analysis process. The pre-read/analysis process and the execution process are carried out in different tasks (that is, the pre-read/analysis process is carried out in a pre-read/analysis process task, while the execution process is carried out in an execution process task (which is separate from the pre-read/analysis process task)) and can thus operate in parallel.
Japanese Patent Application Laid-open No. H5-282020 discloses a numerical controller with an inter-path waiting function, the numerical controller starting inter-path waiting during an execution process for an inter-path waiting command, canceling a waiting state under a specified condition, and checking a condition (specified position/machine position) specified in a block succeeding the inter-path waiting command.
Japanese Patent Application Laid-open No. H10-31509 discloses a numerical controller with an inter-path waiting function, the apparatus not carrying out inter-path waiting during an execution process for an inter-path waiting command but carrying out inter-path waiting after the inter-path waiting command at a timing when an axis movement command/block is completed, wherein a specified condition is used to carry out the inter-path waiting after the inter-path waiting command at the timing when the axis movement command/block is completed.
Japanese Patent Application Laid-open No. 2004-334914 discloses a numerical controller with an inter-path waiting function, the apparatus starting inter-path waiting during an execution process for an inter-path waiting command, canceling a waiting state under a specified condition, and checking the state of axes after the execution of the inter-path waiting command for a specified condition (the rotation speed of a spindle/a motor current value for a specified axis).
The conventional inter-path waiting function provided in a numerical controller carries out an inter-path waiting process during an execution process in a block containing an inter-path waiting code. In this case, the execution process is started after an execution process up to a block preceding a target block to be executed ends. Thus, the inter-path waiting process is precluded from being started until the execution process up to the preceding block ends.
Furthermore, during the execution process, the in-execution state (for example, the remaining amount of movement or a feed speed) of a block prior to a block being executed is precluded from being checked. Thus, the conventional inter-path waiting function fails to carry out the inter-path waiting process taking into account the in-execution state of a block prior to the block being executed.
Moreover, information is exchanged between the pre-read/analysis process task and the execution process task, between detection of the inter-path waiting code during the pre-read/analysis process and the carrying out of the inter-path waiting process during the execution process and between establishment of inter-path waiting based on the inter-path waiting process during the execution process and the beginning of a pre-read/analysis process in the next block. Thus, a delay occurs which corresponds to two task activation periods.
Now, a time chart for the conventional inter-path waiting function shown in FIG. 12 will be described. It is assumed that a block is specified which contains an inter-path waiting code “M500P12”. The conventional inter-path waiting function carries out the following processing during the pre-read/analysis process task.
Pre-read/Analysis Process
One block is loaded from a machining program, and a block “M500P12” containing the inter-path waiting code is loaded.
A “code analysis section” breaks down the specified block into codes to create code analysis data. That is, “M500P12” is broken down into “M”, “500”, “P”, and “12”.
Based on the code analysis data (“M”, “500”, “P”, and “12”) created by the code analysis section, a “function code determination section” determines what function each code has.
“M” and “500” are determined to function as an inter-path waiting code No. 500.
“P” and “12” are determined to allow a first control path and a second control path to carry out inter-path waiting.
An “execution data creation section” creates execution data so as to allow the function determined by the function code determination section to be executed.
Moreover, based on the execution data created by the pre-read/analysis process, the following process is carried out during an execution process task.
Execution Process
An “inter-path waiting section” checks the control path targeted for inter-path waiting (first control path or second control path) for the state thereof and waits for processing for the inter-path waiting “M500P12” in the inter-path waiting section to be carried out.
When the processing in the inter-path waiting section is carried out, inter-path waiting is determined to have been established, and the execution process in the block containing the inter-path waiting code ends.
As shown in FIG. 12, the conventional inter-path waiting function allows the processing in the inter-path waiting section to be carried out during the execution process task for the block containing the inter-path waiting code. During the execution process task, until an execution process in one block ends, an execution process in the next block is prevented from starting. As a disadvantage, the processing in the inter-path waiting section is precluded from being carried out until the execution process in the block immediately before the block containing the inter-path waiting code ends.